package com.biz.primus.ms.commodity.trans;

import com.biz.primus.commodity.vo.backend.SaleTagListItemVo;
import com.biz.primus.ms.commodity.dao.po.SaleTag;
import com.google.common.base.Function;
import javax.annotation.Nullable;


/**
 * @author 江南
 * @usage
 * @reviewer
 * @since 2016/12/22
 */
public class SaleTag2SaleTagListItemVo implements Function<SaleTag,SaleTagListItemVo> {
    @Nullable
    @Override
    public SaleTagListItemVo apply(@Nullable SaleTag input) {
        SaleTagListItemVo resp = new SaleTagListItemVo();
        resp.setId(String.valueOf(input.getId()));
        resp.setStatus(input.getStatus());
        resp.setName(input.getTagName());
        resp.setCreateTimeStamp(input.getCreateTimestamp());
        resp.setIdx(String.valueOf(input.getIdx()));
        resp.setProductCount(input.getProducts().size());
        return resp;
    }
}
